<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>分页操作</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="css/skin.css">
  </head>
  <body>
     <center>
     <div><h3>分页</h3></div>
     <div>
       <table align="center" class="pagetable" cellpadding="0" cellspacing="0" class="tb" align="left">
				<tr>
					<th width="80px">
						编号
					</th>
					<th width="80px">
						姓名
					</th>
					<th width="80px">
						职位
					</th>
					<th width="80px">
						MGR
					</th>
					<th width="240px">
						HIREDATE
					</th>
					<th width="80px">
						SAL
					</th>
					<th width="80px">
						COMM
					</th>
					<th width="80px">
						DEPTNO
					</th>
				</tr>
               <c:forEach items='${pageModel.list}' var="item">
               <tr>
                  <td>${item.empno}&nbsp;</td>
                  <td>${item.ename }&nbsp;</td>
                  <td>${item.job }&nbsp;</td>
                  <td>${item.mgr}&nbsp;</td>
                  <td>${item.hiredate }&nbsp;</td>
                  <td>${item.sal}&nbsp;</td>
                  <td>${item.comm}&nbsp;</td>
                  <td>${item.deptno}&nbsp;</td>
               </tr>
              </c:forEach>
             </table>
             <table>
                <tr>
                  <td>共${pageModel.totalRecords}条记录</td>
                  <td>共${pageModel.totalPages}页</td>
                  <td>当前${pageModel.currPage}页</td>
                  <td></td>
                  <td><a href="PageServlet?page=1">首页</a></td>
                  <td><a href="PageServlet?page=${pageModel.nextPage}">上一页</a></td>
                  <td><a href="PageServlet?page=${pageModel.previousPage}">下一页</a></td>
                  <td><a href="PageServlet?page=${pageModel.totalPages}">末页</a></td>
                </tr>
             </table>
           </div>
     </center>
  </body>
</html>
